<!DOCTYPE HTML>
<html>
<head>
<include file="Public/head" />
<link href="__CSS__/forum.css" rel="stylesheet" />
<script type="text/javascript"
	src="__PUBLIC__/Core/js/ext/magnific/jquery.magnific-popup.min.js"></script>
</head>
<body>
	<include file="Public/header" />
	<div id="main-container" class="container">


		<div class="row">
			<!-- 左边 -->
			<div class="col-xs-9">
				<div class="row">

					<div class="col-xs-12">
						<div class="team-info">
							<div class="team-icon">
								<a href="{:U('/team/'.$team['id'])}"> <img
									src="__PUBLIC__/Core/images/placeholder.png"
									lazy-src="{$team.cover|get_cover=url}" height="80" width="80" />
								</a>
							</div>
							<div class="pull-left team-info">
								<div class="title">
									<h4>{$team.name}</h4>
								</div>

								<div class="team-navs">
									<a id="nav-home" class="team-nav" href="{:U('/team/'.$teamid)}">首页</a>
									<a id="nav-video" class="team-nav"
										href="{:U('/team/video/'.$teamid)}">视频</a> <a id="nav-album"
										class="team-nav team-nav-current"
										href="{:U('/team/forum/'.$teamid)}">论坛</a> <a id="nav-album"
										class="team-nav" href="{:U('/team/album/'.$teamid)}">专辑</a> <a
										id="nav-album" class="team-nav"
										href="{:U('/team/match/'.$teamid)}">比赛</a>
								</div>
							</div>
							<div class="pull-right">

								<div class="follow">
									<a href="javascript:;" class="btn-team-subscription"
										id="mod_follow_btn" data-value="1">+ 订阅</a>

								</div>

								<div class="join">

									<a href="javascript:;" class="btn-team-join"
										id="mod_follow_btn" data-value="1">加入</a>
								</div>
							</div>

						</div>
						<div class="fourm-top common_block_border"
							style="padding: 15px 20px; margin: -15px; margin-top: 0; margin-bottom: 15px">
							<h4>
								<if condition="$isEdit"> 编辑帖子 <else /> 发表新帖 </if>
							</h4>
							<hr />
							<section id="contents">
								<form action="{:U('Team/Forum/doEdit')}" method="post"
									id="edit-article-form">
									<input type="hidden" name="post_id" value="{$post.id}" />
									
									<input type="hidden" name="forum_id" value="{$forum_id}" />
									
									
									<div class="row">
										 
										<div class="col-xs-12">
											<p>
												<input id="title" type="text" name="title" placeholder="标题"
													value="{$post.title}" class="form-control" />
											</p>
										</div>
									</div>
									<p>
										<!-- <textarea name="content" class="form-control" placeholder="说点什么吧～"
                                       style="width:100%; height: 8em;">{$post.content|htmlspecialchars}</textarea>-->


										{:W('ForumUeditorMini/editor',array('contentEditor','content',$post['content'],'100%','250px',$config))}

									</p>

									<p>&nbsp;</p>

									<p class="pull-right">
										<button type="submit" class="btn btn-large btn-primary"
											id="submit-button">
											<span class="glyphicon glyphicon-edit"></span> <span
												id="submit-content"> <if condition="$isEdit">
												编辑帖子 Ctrl+Enter <else /> 发表帖子 Ctrl+Enter </if>
											</span>
										</button>
										<input type="hidden" id="isEdit" value="{$isEdit}">
									</p>
									<p>
										<a class="btn btn-large btn-primary" onclick="history.go(-1)">
											<span class="glyphicon glyphicon-home"></span> 返回帖子列表
										</a>
									</p>
								</form>
							</section>
						</div>
					</div>
				</div>
			</div>

			<div class="col-xs-3">
				<div>


					<div class="right-want-box">
						<div class="row">
							<div class="col-xs-2">
								<span class=" glyphicon glyphicon-flash want-box-icon "></span>
							</div>
							<div class="col-lg-4">
								<a href="#" class="want-box-text" rel="nofollow">我要约战</a>
							</div>
							<div class="col-xs-1">
								<span
									class="glyphicon glyphicon-facetime-video  want-box-share-icon "></span>
							</div>
							<div class="col-xs-4">
								<a href="#" class="want-box-text" rel="nofollow">我要直播</a>
							</div>
						</div>
					</div>


					{:W('TeamSide/hot',array($teamid))}



				</div>
			</div>


		</div>
	</div>

	<script type="text/javascript">
		$(function() {
			$(window).resize(
					function() {
						$("#main-container").css("min-height",
								$(window).height() - 280);
					}).resize();
		});
	</script>
	<!-- /主体 -->

	<!-- 底部 -->
	<include file="Public/footer" />
	<!-- /底部 -->
</body>
</html>

<block name="script"> <script type="text/javascript"
	src="__PUBLIC__/Core/js/ext/atwho/atwho.js"></script>
<link type="text/css" rel="stylesheet"
	href="__PUBLIC__/Core/js/ext/atwho//atwho.css" />
<script>
	//点击编辑或发表按钮之后
	$(function() {
		$('#edit-article-form').keypress(function(e) {
			if (e.ctrlKey && e.which == 13 || e.which == 10) {
				$('#submit-button').focus();
				$("#submit-button").click();
			}
		});

		//var $inputor = $('#contentEditor').atwho(atwho_config);

		var submitCount = 0;
		$('#edit-article-form').submit(function(e) {
			//为了得到编辑器中的内容，触发两次提交事件
			if (submitCount == 0) {
				submitCount = 1;
				$('#edit-article-form').trigger('submit');
				e.preventDefault();
				return false;
			} else {
				submitCount = 0;
			}
			//显示正在提交
			showSubmitting();
			//获取用户输入的内容
			var postData = $(this).serialize();
			var action = $(this).attr('action');
			$.post(action, postData, function(e) {
				if (e.status) {
					showSubmitSuccess(e.info, e.url);
				} else {
					showSubmitError(e.info);
				}
			});
			//停止提交
			e.preventDefault();
			return false;
		});

		function showSubmitError(message) {
			$('#submit-button').removeClass('disabled');
			var isEdit = $('#isEdit').val();
			var text = '';
			if (isEdit) {
				text = '编辑帖子';
			} else {
				text = '发表帖子';
			}
			$('#submit-content').text(text);
			op_error(message, '错误');
		}

		function showSubmitSuccess(message, url) {
			op_success(message, '温馨提示');
			setTimeout(function() {
				location.href = url;
			}, 1500);
		}

		function showSubmitting() {
			$('#submit-button').attr('class', 'btn btn-primary disabled');
			$('#submit-content').text('正在提交');
		}
	})
</script> </block>
